package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * The persistent class for the PAYPLAN database table.
 * 
 */
@Entity
@NamedQuery(name = "Payplan.findAll", query = "SELECT p FROM Payplan p")
public class Payplan implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name = "PAYPLAN_PPID_GENERATOR", sequenceName = "SEQ", initialValue = 1, allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PAYPLAN_PPID_GENERATOR")
	@Column(name = "PP_ID")
	private long ppId;

	@Column(name = "PP_CHARGE")
	private String ppCharge;

	@Column(name = "PP_FOREIGN")
	private String ppForeign;

	@Column(name = "PP_MONEY")
	private BigDecimal ppMoney;

	@Column(name = "PP_OWNER")
	private String ppOwner;

	@Column(name = "PP_PERIOD")
	private BigDecimal ppPeriod;

	@Column(name = "PP_REMARK")
	private String ppRemark;

	@Column(name = "PP_STATE")
	private BigDecimal ppState;

	@Temporal(TemporalType.DATE)
	@JSONField(format = "yyyy-MM-dd")
	@Column(name = "PP_Date")
	private Date ppDate;

	public Date getPpDate() {
		return ppDate;
	}

	public void setPpDate(Date ppDate) {
		this.ppDate = ppDate;
	}

	// bi-directional many-to-one association to Contract
	@ManyToOne
	@JoinColumn(name = "CO_ID")
	private Contract contract;

	// bi-directional many-to-one association to Payrecord
	@OneToOne(cascade = { CascadeType.REMOVE }, mappedBy = "payplan")
	private Payrecord payrecord;

	// bi-directional many-to-one association to Order
	@ManyToOne
	@JoinColumn(name = "OR_ID")
	private Order order;

	public Payplan() {
	}

	public long getPpId() {
		return this.ppId;
	}

	public void setPpId(long ppId) {
		this.ppId = ppId;
	}

	public String getPpCharge() {
		return this.ppCharge;
	}

	public void setPpCharge(String ppCharge) {
		this.ppCharge = ppCharge;
	}

	public String getPpForeign() {
		return this.ppForeign;
	}

	public void setPpForeign(String ppForeign) {
		this.ppForeign = ppForeign;
	}

	public BigDecimal getPpMoney() {
		return this.ppMoney;
	}

	public void setPpMoney(BigDecimal ppMoney) {
		this.ppMoney = ppMoney;
	}

	public String getPpOwner() {
		return this.ppOwner;
	}

	public void setPpOwner(String ppOwner) {
		this.ppOwner = ppOwner;
	}

	public BigDecimal getPpPeriod() {
		return this.ppPeriod;
	}

	public void setPpPeriod(BigDecimal ppPeriod) {
		this.ppPeriod = ppPeriod;
	}

	public String getPpRemark() {
		return this.ppRemark;
	}

	public void setPpRemark(String ppRemark) {
		this.ppRemark = ppRemark;
	}

	public BigDecimal getPpState() {
		return this.ppState;
	}

	public void setPpState(BigDecimal ppState) {
		this.ppState = ppState;
	}

	public Contract getContract() {
		return this.contract;
	}

	public void setContract(Contract contract) {
		this.contract = contract;
	}

	public Payrecord getPayrecord() {
		return this.payrecord;
	}

	public void setPayrecord(Payrecord payrecord) {
		this.payrecord = payrecord;
	}

	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

}